<!--
 * @Author: xyf
 * @Date: 2021-06-28 18:11:18
 * @LastEditTime: 2021-07-13 14:30:09
 * @LastEditors: xyf
 * @Description: 示例
-->
<template>
  <div class="container">示例页面</div>
</template>

<script>
  // 避免Vue原型很臃肿及性能开销，需在使用的组件中导入对应的API模块
  import { sampleMock } from '@/api/sample'

  export default {
    name: 'Sample',
    mounted() {
      // 请求mock示例接口
      sampleMock().then((res) => {
        console.log(res)
      })
      // 请求真实接口示例
      this.$store.dispatch('sample/login').then((res) => {
        console.log(res)
      })
    },
    methods: {
      getToken() {
        console.log(this.$store.getters.token)
      }
    }
  }
</script>

<style lang="scss" scoped></style>
